#include "LatestMsgNumNotify.h"


LatestMsgNumNotify::LatestMsgNumNotify(const string& chat_room_id, const int& num_msg, const string& time) {
    this->chat_room_id = chat_room_id;
    this->num_msg = num_msg;
    this->time = time;
}

LatestMsgNumNotify::LatestMsgNumNotify(json latest_msg_num_notify_json) {
    this->unserialize(latest_msg_num_notify_json);
}


json LatestMsgNumNotify::serialize() const {
    json j;
    j["chat_room_id"] = this->chat_room_id;
    j["num_msg"] = this->num_msg;
    j["time"] = this->time;
    return j;
}

void LatestMsgNumNotify::unserialize(const json& j) {
    this->chat_room_id = j["chat_room_id"];
    this->num_msg = j["num_msg"];
    this->time = j["time"];
}

string LatestMsgNumNotify::get_chat_room_id() const {
    return this->chat_room_id;
}

int LatestMsgNumNotify::get_num_msg() const {
    return this->num_msg;
}

string LatestMsgNumNotify::get_time() const {
    return this->time;
}

void LatestMsgNumNotify::set_chat_room_id(const string& chat_room_id) {
    this->chat_room_id = chat_room_id;
}

void LatestMsgNumNotify::set_num_msg(const int& num_msg) {
    this->num_msg = num_msg;
}

void LatestMsgNumNotify::set_time(const string& time) {
    this->time = time;
}

void LatestMsgNumNotify::add_one_num(string time) {
    this->num_msg++;
    this->time = time;
}

